<template>
  <div class="">
    <h2>子组件执行父组件的方法</h2>
    <span>参数1：{{ v1 }}</span
    ><br />
    <span>参数2：{{ v2 }}</span
    ><br />
    <span>结果：{{ callback(v1, v2) }}</span
    ><br />
  </div>
</template>

<script>
export default {
  name: "Child",
  components: {},
  props: {
    callback: Function,
  },
  data() {
    return {
      v1: 10,
      v2: 5,
    };
  },
};
</script>
